<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改跟进记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-followup-edit" th:object="${crmFollowUp}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">跟进用户：</label>
                    <div class="col-sm-8">
                        <input name="followUpId" th:field="*{followUpUser}" class="form-control" type="text" disabled>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">跟进时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="followUpTime" th:value="${#dates.format(crmFollowUp.followUpTime, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" id="follow-up-time" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">跟进方式：</label>
                    <div class="col-sm-8">
                        <select name="followUpContactCode" class="form-control" th:with="type=${@dict.getType('crm_contact_code')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{followUpContactCode}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">跟进记录：</label>
                    <div class="col-sm-8">
                        <textarea name="followUpRecords" class="form-control" rows="6">[[*{followUpRecords}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/student/followup";
        $("#form-followup-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-followup-edit').serialize());
            }
        }

        // $("input[name='followUpTime']").datetimepicker({
        //     format: "yyyy-mm-dd",
        //     minView: "month",
        //     autoclose: true
        // });

        $(function(){
            <!-- laydate -->
            layui.use('laydate', function(){
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#follow-up-time',
                    type: 'datetime',
                    trigger: 'click'
                });
            });
        });
    </script>
</body>
</html>